home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / asm_subr.arc / COMON < prev    next >
Encoding:
Text File  |  1985-12-15  |  1.3 KB  |  43 lines

  1. ;-------------------------comon routine begins--------------------------+
  2. ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
  3. ;         page : 38
  4. ;
  5. ; NAME COMON
  6. ; ROUTINE FOR COMMUNICATIONS LINE ON
  7. ;
  8. ; FUNCTION: This routine turns on the handshaking signal DTR (line 20)
  9. ; and RTS (line 4) on the specified communications line.
  10. ; INPUT: Upon entry DX contains the unit number (0 for comm1: and 1 for
  11. ; comm2:).
  12. ; OUTPUT: Just to the communications line.
  13. ; REGISTERS USED:  No registers modified.  DX is used for input.
  14. ; SEGMENTS REFERENCED:  During the routine the system data segment is
  15. ; referenced.
  16. ; ROUTINES CALLED:  None
  17. ; SPECIAL NOTES: None
  18. ;
  19. ; ROUTINE TO TURN ON INPUT FROM A COMMUNICATIONS LINE
  20. ;
  21. comon    proc    far
  22. ;
  23.     push    ds        ; save registers
  24.     push    dx
  25.     push    si
  26. ;
  27.     mov    si,dx        ; look up address of comm line
  28.     add     si,si        ; double to index into table
  29.     mov    dx,40h        ; segment of system I/O table
  30.     mov    ds,dx        ; set data segment to this table
  31.     mov    dx,[si]        ; look up data
  32.     add    dx,4        ; modem control register
  33.     mov    al,3        ; set DTR and RTS
  34.     out    dx,al        ; send out control byte
  35. ;
  36.     pop    si        ; restore registers
  37.     pop    dx
  38.     pop    ds
  39.     ret            ; return
  40. ;
  41. comon    endp
  42. ;-------------------------comon routine ends---------------------------+
  43.